package com.kma.summer2012.client;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.google.gwt.core.client.GWT;
import com.kma.summer2012.shared.model.UIUser;

import java.math.BigInteger;
import java.util.List;

@RemoteServiceRelativePath("UserService")
public interface UserService extends RemoteService {

    UIUser getUserById(BigInteger id);
    List<UIUser> getUserAllUsers();

    /**
     * Utility/Convenience class.
     * Use UserService.App.getInstance() to access static instance of UserServiceAsync
     */
    public static class App {
        private static final UserServiceAsync ourInstance = (UserServiceAsync) GWT.create(UserService.class);

        public static UserServiceAsync getInstance() {
            return ourInstance;
        }
    }

}
